<?php
//------------------------------------------------------------------------------
// File               : V_TintucList
// Modification       :
//------------------------------------------------------------------------------
// Date(yyyy.mm.dd)   Developer                       Action
//------------------------------------------------------------------------------
// 2007.03.15         Oanhhtk                         Created
//------------------------------------------------------------------------------

function V_TuyendungList(&$arrayData,$arrayDataLimit){
	global $LANG;
    $ulr = "?".MODUL."=tuyendung&".ACTION."=";
?>
<?= CM_showError() ?> 
<?
    //phan trang
	$totalRows = 0;
	$curPage =1;
	$strStart =0;
	$strEnd=0;
	
	$totalRows=count($arrayData);

	$curPage =CM_getParameter("curPg");
	if(((int)$curPage)==0) $curPage =1;
	
	$totalPage = 	(int)($totalRows/50);
	if($totalRows % 50 > 0 ) $totalPage ++;
	
	if($totalRows >0){
		$strStart = ($curPage -1) * 50+1;
		$strEnd   = ($curPage )   * 50 ;
		if($strEnd  > $totalRows ) $strEnd  = $totalRows;
	}
?>	

<script>
function GotoPage(iPage) 
{
    document.frm.curPg.value=iPage;
    document.frm.submit()          ;
}
</script>


<table width="100%" cellpadding="0" cellspacing="0">
<tr>
	<td style=" padding-bottom:4px;">
		<font style="font-family:tahoma; font-weight:bold; font-size:14px; text-decoration:none; color:#004175;  "><?=$arrayDataLimit[0]['tieu_de']?></font>
		&nbsp;<font style="color:#999999; font-size:12px; font-family:tahoma; ">(<?=$arrayDataLimit[0]['ngay_tao']?>)</font>
	</td>
</tr>
<tr>
	<td style=" padding-bottom:4px;">
		<font style="font-family:tahoma; font-size:12px; line-height:18px;"><?=$arrayDataLimit[0]['noi_dung']?></font>
	</td>
</tr>
<form name="frm" action="../run/main.php?modul=tuyendung&action=<?=$action?>"  method="post" >
	<?
		if(!empty($arrayData)){
			$curRow=0;
			$i=0;
	?>
<tr>
	<td style="border-bottom:2px solid #00CC66; padding-bottom:3px; padding-top:20px; ">
		<font style="font-family:tahoma; font-weight:bold; font-size:14px; color:#004175; ">Các tin tuyển dụng đã đăng:</font>
	</td>
</tr>
	<?
			foreach($arrayData as $row){
				$curRow ++;
				if( $curRow < $strStart ) continue;
				if( $curRow > $strEnd )  break;
				$i+=1;
				
				
	?>
		<tr>
			<td>
				<font style="font-family:tahoma; font-size:12px; color:#000000; "><?=$i?>.</font>
				&nbsp;<a href="?modul=tuyendung&action=View&id=<?=$row['id']?>" class="title_tuyendung" ><?=$row['tieu_de']?></a>
			</td>
		</tr>
			
	<?
				
			}// end foreach
	?>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<?
		
			if($totalPage>1){		
		?>
		<tr>
			<td>
			
		<?
				echo "<font style=\"font-size:14px;\">Trang: </font>";		
				for($i=1;$i<= $totalPage;$i++){ 
					if($i != $curPage) echo "<font style=\"font-size:14px;\"><a href=\"javascript:GotoPage('$i')\" style=\"color:#000000; text-decoration:underline;\">$i</a></font>  ";
					else 			   echo "<SPAN class=bk12-140 style=\"color:#FF0000; font-size:16px;\">$i  </SPAN> " ;
				}
			}// enf if($totalPage>1)
		?>
		</td>
	</tr>
	<?
		}
	?>
<input type=hidden  name="curPg"  value="0" >
<input type=hidden  name="id"  value="<?=CM_getParameter('id')?>" >
<input type=hidden  name="textfield"  value="<?=CM_getParameter('textfield')?>" >
</form>		
</table>




<?php
foreach ($_POST as $key => $value) {
		$value = htmlspecialchars( CM_getParameter($key));
		echo '<input type=hidden  name="'.$key.'"  value="'.$value.'" >';
		echo "\n";
	}
}
?>